<template>
  <div class="app-container">
    <!-- 预约单信息 -->
    <h5 class="titleInfo">预约单信息</h5>
    <el-form ref="list" :inline="true" :model="list" label-width="130px">
      <el-row>
        <el-col :span="12">
          <el-form-item label="预约单号">
            <span class="spanToInput">{{list.orderSn | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="预约状态">
            <span class="spanToInput">{{list.orderStatus | orderStatusType}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="预约医院">
            <span class="spanToInput">{{list.hospitalName | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="预约项目">
            <span class="spanToInput">{{list.projectName | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="预约日期">
            <span class="spanToInput">{{list.orderDate | filterNull}}</span>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <!-- 客户信息 -->
    <div class="divBar"></div>
    <h5 class="titleInfo">客户信息</h5>
    <el-form ref="list" :inline="true" :model="list" label-width="130px">
      <el-row>
        <el-col :span="12">
          <el-form-item label="客户手机号">
            <span class="spanToInput">{{list.userPhone | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="客户姓名">
            <span class="spanToInput">{{list.userName | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="客户年龄">
            <span class="spanToInput">{{list.age | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="客户性别">
            <span class="spanToInput">{{list.sex | sexFn}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="职业">
            <span class="spanToInput">{{list.workplace | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="推荐人姓名">
            <span class="spanToInput">{{list.serverName | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="推荐人手机号">
            <span class="spanToInput">{{list.serverPhone | filterNull}}</span>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <!-- 其他信息 -->
    <div class="divBar"></div>
    <h5 class="titleInfo">其他信息</h5>
    <el-form ref="list" :inline="true" :model="list" label-width="130px">
      <el-row>
        <el-col :span="12">
          <el-form-item label="性格特点">
            <span class="spanToInput">{{list.userNature | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="用户关注">
            <span class="spanToInput">{{list.userConcern | userFocus}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="曾咨询医院">
            <span class="spanToInput">{{list.knowHospitals | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="曾做过项目">
            <span class="spanToInput">{{list.doneProject | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="经济自主权">
            <span class="spanToInput">{{list.autoEconomic | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="经济实力">
            <span class="spanToInput">{{list.powerEconomic | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="预期消费">
            <span class="spanToInput">{{list.expectFree | expectFreeType}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="铺垫项目">
            <span class="spanToInput">{{list.followProject | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="铺垫程度">
            <span class="spanToInput">{{list.followLevel | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="备注">
            <span class="spanToInput">{{list.submitRemark | filterNull}}</span>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>
<script>
import { findProjectOrderProjectByOrderSn } from "@/api/subscribeManage";
export default {
  name: "subManageInfo",
  data() {
    return {
      val: "1",
      userId: "",
      list: {}
    };
  },
  filters: {
    filterNull(e) {
      if (!e) {
        return "暂无";
      } else {
        return e;
      }
    },
    orderStatusType(e) {
      return window.helper.orderStatusType(String(e));
    },
    cardNull(e) {
      return window.helper.cardType(e);
    },
    userFocus(e) {
      return window.helper.userFocus(e);
    },
    sexFn(e) {
      switch (e) {
        case 0:
          return "普通";
        case 1:
          return "男";
        case 2:
          return "女";
        default:
          return "暂无";
      }
    },
    expectFreeType(e) {
      return window.helper.expectFreeType(String(e));
    }
  },
  mounted() {
    console.log();
    // this.userId = this.$route.query.userId;
    this.getList();
  },
  methods: {
    getList() {
      findProjectOrderProjectByOrderSn({ id: this.$route.query.userId })
        .then()
        .then(res => {
          console.log(res);
          if (!res.data.code) {
            this.list = res.data.data;
          } else {
            this.$message.error(res.data.msg);
          }
        })
        .catch(error => {
          this.$message.error(error);
        });
    }
  }
};
</script>

<style scoped>
.app-container {
  padding: 0px !important;
}
.form {
  margin-left: 268px;
}
</style>